package topo.data;

import java.io.Serializable;
import java.sql.Timestamp;
import topo.utils.ConstantDefine;

public class NodeDevice implements Serializable {
    private String nodeName = "";

    private String displayName = "";

    private String groupName = "";

    private String nodeType = "";

    private String deviceLogicType = ConstantDefine.NodeLogic_Unkown;

    private int poseX = 250;

    private int poseY = 100;

    private int isLockedXY = 0;

    private int isManagerNode = 1;

    private String managerProtocol = "SNMP";

    private int snmpVersion = 1;

    private int snmpPort = 161;

    private String readCommit = "public";

    private String writeCommit = "private";

    private int isEnableSNMPProxy = 0;

    private String snmpProxyIP = "";

    private String ipAddress = "127.0.0.1";

    private String deviceMainMAC = "";

    private String deviceSystemOID = "";

    private String deviceSystemDesc = "";

    private String deviceDepartment = "";

    private String ownerName = "";

    private String localAddress = "";

    private String repairRecord = "";

    private String nodeParam = "";

    private String nodeCompany = "";

    private Timestamp createTime = new Timestamp(System.currentTimeMillis());

    private String nodeRemarks = "";

    private String nodeDesc = "";

    public String toString() {
        return getDisplayName();
    }

    public boolean equals(Object obj) {
        if ((obj instanceof NodeDevice)) {
            NodeDevice theDBkey = (NodeDevice) obj;
            if (getNodeName().equals(theDBkey.getNodeName())) {
                return true;
            }
        }
        return false;
    }

    public int hashCode() {
        return this.nodeName.hashCode();
    }

    public String genKey() {
        return this.ipAddress;
    }

    public String getNodeName() {
        return this.nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public int getPoseX() {
        return this.poseX;
    }

    public void setPoseX(int poseX) {
        this.poseX = poseX;
    }

    public int getPoseY() {
        return this.poseY;
    }

    public void setPoseY(int poseY) {
        this.poseY = poseY;
    }

    public String getIpAddress() {
        return this.ipAddress;
    }

    public Timestamp getCreateTime() {
        return this.createTime;
    }

    public String getReadCommit() {
        return this.readCommit;
    }

    public String getWriteCommit() {
        return this.writeCommit;
    }

    public String getNodeDesc() {
        return this.nodeDesc;
    }

    public String getNodeType() {
        return this.nodeType;
    }

    public String getGroupName() {
        return this.groupName;
    }

    public String getLocalAddress() {
        return this.localAddress;
    }

    public String getOwnerName() {
        return this.ownerName;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public void setIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
    }

    public void setReadCommit(String readCommit) {
        this.readCommit = readCommit;
    }

    public void setWriteCommit(String writeCommit) {
        this.writeCommit = writeCommit;
    }

    public void setNodeDesc(String nodeDesc) {
        this.nodeDesc = nodeDesc;
    }

    public void setNodeType(String nodeType) {
        this.nodeType = nodeType;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public void setLocalAddress(String localAddress) {
        this.localAddress = localAddress;
    }

    public void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }

    public String getDisplayName() {
        return this.displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public String getNodeParam() {
        return this.nodeParam;
    }

    public void setNodeParam(String nodeParam) {
        this.nodeParam = nodeParam;
    }

    public String getNodeCompany() {
        return this.nodeCompany;
    }

    public void setNodeCompany(String nodeCompany) {
        this.nodeCompany = nodeCompany;
    }

    public String getRepairRecord() {
        return this.repairRecord;
    }

    public void setRepairRecord(String repairRecord) {
        this.repairRecord = repairRecord;
    }

    public String getNodeRemarks() {
        return this.nodeRemarks;
    }

    public void setNodeRemarks(String nodeRemarks) {
        this.nodeRemarks = nodeRemarks;
    }

    public void setSnmpPort(int snmpPort) {
        this.snmpPort = snmpPort;
    }

    public int getSnmpPort() {
        if (this.snmpPort == 0) {
            return 161;
        }
        return this.snmpPort;
    }

    public int getIsManagerNode() {
        return this.isManagerNode;
    }

    public void setIsManagerNode(int isManagerNode) {
        this.isManagerNode = isManagerNode;
    }

    public String getDeviceLogicType() {
        return this.deviceLogicType;
    }

    public void setDeviceLogicType(String deviceLogicType) {
        this.deviceLogicType = deviceLogicType;
    }

    public String getManagerProtocol() {
        return this.managerProtocol;
    }

    public void setManagerProtocol(String managerProtocol) {
        this.managerProtocol = managerProtocol;
    }

    public int getSnmpVersion() {
        return this.snmpVersion;
    }

    public void setSnmpVersion(int snmpVersion) {
        this.snmpVersion = snmpVersion;
    }

    public int getIsEnableSNMPProxy() {
        return this.isEnableSNMPProxy;
    }

    public void setIsEnableSNMPProxy(int isEnableSNMPProxy) {
        this.isEnableSNMPProxy = isEnableSNMPProxy;
    }

    public String getSnmpProxyIP() {
        return this.snmpProxyIP;
    }

    public void setSnmpProxyIP(String snmpProxyIP) {
        this.snmpProxyIP = snmpProxyIP;
    }

    public String getDeviceMainMAC() {
        return this.deviceMainMAC;
    }

    public void setDeviceMainMAC(String deviceMainMAC) {
        this.deviceMainMAC = deviceMainMAC;
    }

    public String getDeviceSystemOID() {
        return this.deviceSystemOID;
    }

    public void setDeviceSystemOID(String deviceSystemOID) {
        this.deviceSystemOID = deviceSystemOID;
    }

    public String getDeviceSystemDesc() {
        return this.deviceSystemDesc;
    }

    public void setDeviceSystemDesc(String deviceSystemDesc) {
        this.deviceSystemDesc = deviceSystemDesc;
    }

    public String getDeviceDepartment() {
        return this.deviceDepartment;
    }

    public void setDeviceDepartment(String deviceDepartment) {
        this.deviceDepartment = deviceDepartment;
    }

    public int getIsLockedXY() {
        return this.isLockedXY;
    }

    public void setIsLockedXY(int isLockedXY) {
        this.isLockedXY = isLockedXY;
    }
}